import { AppNetworkTimeout } from './app-network-timeout.entity'
import { AppTabBar } from './app-tab-bar.entity'
import { AppWindow } from './app-window.entity'
import { AppPage } from './app-page.entity'
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, OneToMany } from 'typeorm'

@Entity()
export class App {
  @PrimaryGeneratedColumn()
  id: number

  @OneToMany(type => AppPage, pages => pages.app)
  pages: AppPage[]

  @ManyToOne(type => AppWindow, window => window.app)
  window: AppWindow

  @ManyToOne(type => AppTabBar, tabBar => tabBar.app)
  tabBar: AppTabBar

  @ManyToOne(type => AppNetworkTimeout, networkTimeout => networkTimeout.app)
  networkTimeout: AppNetworkTimeout

  @Column()
  debug: boolean
}
